package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.WxNewsMapper;
import com.ruoyi.business.domain.WxNews;
import com.ruoyi.business.service.IWxNewsService;

/**
 * 社区资讯Service业务层处理
 * 
 * @author asher
 * @date 2021-11-13
 */
@Service
public class WxNewsServiceImpl implements IWxNewsService 
{
    @Autowired
    private WxNewsMapper wxNewsMapper;

    /**
     * 查询社区资讯
     * 
     * @param newsId 社区资讯主键
     * @return 社区资讯
     */
    @Override
    public WxNews selectWxNewsByNewsId(Integer newsId)
    {
        return wxNewsMapper.selectWxNewsByNewsId(newsId);
    }

    /**
     * 查询社区资讯列表
     * 
     * @param wxNews 社区资讯
     * @return 社区资讯
     */
    @Override
    public List<WxNews> selectWxNewsList(WxNews wxNews)
    {
        return wxNewsMapper.selectWxNewsList(wxNews);
    }

    /**
     * 新增社区资讯
     * 
     * @param wxNews 社区资讯
     * @return 结果
     */
    @Override
    public int insertWxNews(WxNews wxNews)
    {
        wxNews.setCreateTime(DateUtils.getNowDate());
        return wxNewsMapper.insertWxNews(wxNews);
    }

    /**
     * 修改社区资讯
     * 
     * @param wxNews 社区资讯
     * @return 结果
     */
    @Override
    public int updateWxNews(WxNews wxNews)
    {
        wxNews.setUpdateTime(DateUtils.getNowDate());
        return wxNewsMapper.updateWxNews(wxNews);
    }

    /**
     * 批量删除社区资讯
     * 
     * @param newsIds 需要删除的社区资讯主键
     * @return 结果
     */
    @Override
    public int deleteWxNewsByNewsIds(Integer[] newsIds)
    {
        return wxNewsMapper.deleteWxNewsByNewsIds(newsIds);
    }

    /**
     * 删除社区资讯信息
     * 
     * @param newsId 社区资讯主键
     * @return 结果
     */
    @Override
    public int deleteWxNewsByNewsId(Integer newsId)
    {
        return wxNewsMapper.deleteWxNewsByNewsId(newsId);
    }
}
